package com.atguigu.gulimail.order.dubbo;

import com.atguigu.common.service.order.OrderRPCService;
import com.atguigu.common.utils.R;
import com.atguigu.gulimail.order.dao.OrderDao;
import com.atguigu.gulimail.order.entity.OrderEntity;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author fangy
 * @date 2022-10-22 16:20
 */
@DubboService
public class OrderRPCServiceImpl implements OrderRPCService {

    @Autowired
    OrderDao orderDao;

    @Override
    public R getOrderStatus(String orderSn) {

        OrderEntity orderEntity = orderDao.selectOne(new QueryWrapper<OrderEntity>().eq("order_sn", orderSn));

        return R.ok().setData(orderEntity);
    }
}
